package com.monco.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.monco.entity.Notice;
import com.monco.mapper.NoticeMapper;
import com.monco.service.INoticeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
/**
* <p>
    *  服务实现类
    * </p>
*
* @author com/monco
* @since 2020-04-19
*/
@Service
public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements INoticeService {

    @Resource
    private NoticeMapper noticeMapper;

    @Override
    public List<Notice> getNoticeList(Notice notice) {
        return noticeMapper.selectList(getWrapper(notice));
    }

    @Override
    public IPage<Notice> getNoticePage(IPage<Notice> page, Notice notice) {
        return noticeMapper.selectPage(page, getWrapper(notice));
    }

    private QueryWrapper<Notice> getWrapper(Notice notice) {
        QueryWrapper<Notice> queryWrapper = new QueryWrapper<>();
        return queryWrapper;
    }
}
